<!DOCTYPE html>
<html>
 
<head>
    <meta charset="UTF-8">
    <title>数组分隔</title>
</head>
 
<body>
    <script>
        let arr = ['aa', 'bb', 'cc', 'ee'];
        let delimiter = '|';
        let result = '';
        for (let i = 0; i < arr.length; i++) {
            result += arr[i];
            if (i !== arr.length - 1) {
                result += delimiter;
            }
        }
        console.log(result);
 
    </script>
</body>
 
</html>